agendaPersonal :: [(String,Int,Int,Int,Int)] -> [(String,Int,Int,Int,Int)]
agendaPersonal [] = []
agendaPersonal [x] = [x]
agendaPersonal (x:y:xs) |(fecha x == fecha y)&&(horaFinal x <= horaComienzo y) = [x] ++ agendaPersonal (y:xs)
			|(fecha x == fecha y)&&(horaFinal x > horaComienzo y) && (prioridad x >= prioridad y) = [x] ++ agendaPersonal xs
			|(fecha x == fecha y)&&(horaFinal x > horaComienzo y) && (prioridad x < prioridad y) = [y] ++ agendaPersonal xs
			| otherwise = agendaPersonal xs



fecha :: (String,Int,Int,Int,Int) -> Int
fecha (d,f,hc,hf,p) = f

horaComienzo :: (String,Int,Int,Int,Int) -> Int
horaComienzo (d,f,hc,hf,p) = hc	

horaFinal :: (String,Int,Int,Int,Int) -> Int
horaFinal (d,f,hc,hf,p) = hf

prioridad :: (String,Int,Int,Int,Int) -> Int
prioridad (d,f,hc,hf,p) = p
